@extends('common.base-master')

@section('html-head')
    <!-- Bootstrap -->
    <script src="{{url('js/lib/bootstrap.min.js')}}"></script>
    <link rel="stylesheet" type="text/css" href="{{url('css/bootstrap.min.css')}}">
    <link href="{{url('css/investors.css')}}" type="text/css" rel="stylesheet">
@endsection

@section('html-body')
<main>
	<div class="mainWrapp">
        @include('common.company-section')
		<div class="contain">
			<section class="nav_list">
				<div>
					<div class="list">
						<span class="proList"><button class="clear"></button></span>
					</div>
					<div class="search_info">
						<input type="text" placeholder="请输入您要搜索的信息" />
					</div>
					<div class="row">
						<nav>
							<ul>
								<li><a href="#">轮段</a></li>
								<li><a href="#">领域</a></li>
								<li><a href="#">地区</a></li>
							</ul>
						</nav>

					</div>
					<div class="filter-row">
						<ul class="tab filter-1 hide" data-index="1">
                            @foreach($phases as $phase)
							    <li><a href="#" keyword="{{$phase->id}}">{{$phase->phase}}</a></li>
                            @endforeach
						</ul>
						<ul class="tab filter-2 hide" data-index="2">
                            @foreach($fields as $field)
							    <li><a href="#" keyword="{{$field->id}}">{{$field->field}}</a></li>
                            @endforeach

						</ul>
						<ul class="tab filter-3 hide" data-index="3">
                            <li><a name="district" href="javascript:void(0)" dist_name="">全部</a></li>
                            @foreach(\App\District::all() as $district)
                                <li><a name="district" href="javascript:void(0)" keyword="{{$district->dist_name}}" dist_name="{{urlencode
                                ($district->dist_name)}}">{{$district->dist_name}}</a></li>
                            @endforeach
						</ul>
					</div>
				</div>
			</section>
			<section>
				<h3>项目简介</h3>
				<p class="count"><em>{{\App\User::whereStatus(1)->whereRole(1)->count()}}</em> \ 筛选结果</p>
				<div>
					<ul class="nav_tab nav_list">
						<li class="desc">投资人简介</li>
						<li class="stage">投资领域</li>
						<li class="type">投资金额</li>
						<li class="address">投资案例</li>
						<li class="member">操作</li>
					</ul>
					<div class="content">
						<ul>
                            @if($investors)
                                @foreach($investors as $investor)
                                    @if($investor->userInfo)
                            <li>
								<dl>
									<dt>
										<a href="{{route('Home.Investor.getInvestorByUserId' , ['id'=>$investor->id])}}"><img src="{{route('Api.Photo.Show',['id'=>$investor->id])}}" /></a>
									</dt>
									<dd class="commpany">
										<p><a href="{{route('Home.Investor.getInvestorByUserId' , ['id'=>$investor->id])}}"><strong>{{$investor->userInfo->realname}}</strong></a></p>
										<p>@if($investor->userInfo){{$investor->userInfo->user_desc}}@endif</p>
									</dd>
									<dd class="list">
										<div class="list_content">
											<p class="stage"><em class="reveal">投资领域</em><em class="floatR">
                                                @if($fields = $investor->getFieldsByUserId($investor->id))
                                                    @foreach($fields as $field)
                                                        {{$field}}<br>
                                                    @endforeach
												@else
													暂无数据
                                                @endif
                                                </em>
                                            </p>
											<p class="type"><em class="reveal">投资金额</em>
                                                <em class="floatR">
                                                    @if($account = $investor->getInvestAreaByUserId($investor->id))
                                                        {{$account}}
                                                    @else
                                                        暂无投资数据
                                                    @endif
                                                </em></p>
											<p class="address"><em class="reveal">投资案例</em>
                                                <em class="floatR">
                                                @if($projects = $investor->getInvestProjectByUserId($investor->id))
                                                    @foreach($projects as $project)
                                                       {{$project->project_name}}
                                                    @endforeach
                                                @else
                                                    暂无投资项目
                                                @endif
                                                </em>
                                            </p>
											<p class="member"><button class="reveal" data="{{$investor->id}}">提交项目</button></p>
										</div>
									</dd>
								</dl>
                            </li>
                                    @endif
                                @endforeach
                            @endif
                                    </ul>
					</div>
				</div>
                <p class="more_bar">查看更多</p>
			</section>
		</div>
	</div>

	<div class="p_pos createProject">
		<!--单选1-->
		<div class="new">
			<p>您还没有项目，现在去创建吧！</p><p>
			<a href="{{route('Home.Project.showCreateProject')}}"><button>创建项目</button></a>
			<em class="close"></em>
			</p>
		</div>
		<!--单选2-->
		<div class="p_pos_s" style="display: none;">
			<p>申请融资</p>
			<select>
                @if(Auth::user())
                @if($userId = Auth::user()->id)
                    @if($projects = \App\Project::whereUserId($userId)->get())
				    @foreach($projects as $project)
                        <option value="{{$project->id}}">{{$project->project_name}}</option>
                    @endforeach
                    @endif
                @endif
                @endif

			</select><br>
			<button>提交项目</button>
			<em class="close"></em>
		</div>
	</div>
	<div class="mirror">123</div>
</main>
<script type="text/javascript">
    var getProjectByUserId              = "{{route('Api.Project.getProjectByUserId')}}";
    var CommitProjectToInvestor         = "{{route('Api.Project.CommitProjectToInvestor')}}";
    var getMore                         = "{{route('Api.Investor.getInvestorMore')}}";
    var showPhoto                       = "{{route('Api.Photo.Show' ,['id'=>0])}}";
    var getDetailById                   = "{{route('Home.Investor.getInvestorByUserId',['id'=>0])}}";
    var getSearchMessageByTag           = "{{route('Api.Investor.getSearchMessage')}}";

</script>
<script src="{{url('js/investor_more.js')}}"></script>
<script src="{{url('js/investors.js')}}"></script>
@endsection